import request from '@/utils/request'

// 查询精选分类列表
export function listSelectedCategory(query) {
  return request({
    url: '/supermarket/selectedCategory/list',
    method: 'get',
    params: query
  })
}

// 查询精选分类详细
export function getSelectedCategory(id) {
  return request({
    url: '/supermarket/selectedCategory/' + id,
    method: 'get'
  })
}

// 新增精选分类
export function addSelectedCategory(data) {
  return request({
    url: '/supermarket/selectedCategory',
    method: 'post',
    data: data
  })
}

// 修改精选分类
export function updateSelectedCategory(data) {
  return request({
    url: '/supermarket/selectedCategory',
    method: 'put',
    data: data
  })
}

// 上下架精选分类
export function publishSelectedCategory(data) {
  return request({
    url: '/supermarket/selectedCategory/publish',
    method: 'post',
    data: data
  })
}

// 删除精选分类
export function delSelectedCategory(id) {
  return request({
    url: '/supermarket/selectedCategory/' + id,
    method: 'delete'
  })
}
